<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: include/pico/i2c_slave.h Source File</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.0.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('i2c__slave_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle"><div class="title">i2c_slave.h</div></div>
</div><!--header-->
<div class="contents">
<a href="i2c__slave_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * Copyright (c) 2021 Valentin Milea &lt;valentin.milea@gmail.com&gt;</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> * Copyright (c) 2023 Raspberry Pi (Trading) Ltd.</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> *</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="comment"> */</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#ifndef _PICO_I2C_SLAVE_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#define _PICO_I2C_SLAVE_H</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &quot;<a class="code" href="rp2__common_2hardware__i2c_2include_2hardware_2i2c_8h.html">hardware/i2c.h</a>&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="group__pico__i2c__slave.html#gad8b613f0d4e9d1b9511ca0b6d6ab7e8c">   33</a></span><span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code hl_enumeration" href="group__pico__i2c__slave.html#gad8b613f0d4e9d1b9511ca0b6d6ab7e8c">i2c_slave_event_t</a></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>{</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="group__pico__i2c__slave.html#ggad8b613f0d4e9d1b9511ca0b6d6ab7e8ca7bc1a9bb9db707479c140a49c4d62a51">   35</a></span>    <a class="code hl_enumvalue" href="group__pico__i2c__slave.html#ggad8b613f0d4e9d1b9511ca0b6d6ab7e8ca7bc1a9bb9db707479c140a49c4d62a51">I2C_SLAVE_RECEIVE</a>, </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="group__pico__i2c__slave.html#ggad8b613f0d4e9d1b9511ca0b6d6ab7e8ca495a6f0ce75738519ac201349ac38c22">   36</a></span>    <a class="code hl_enumvalue" href="group__pico__i2c__slave.html#ggad8b613f0d4e9d1b9511ca0b6d6ab7e8ca495a6f0ce75738519ac201349ac38c22">I2C_SLAVE_REQUEST</a>, </div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="group__pico__i2c__slave.html#ggad8b613f0d4e9d1b9511ca0b6d6ab7e8ca857dc8c139941a8f8bb6888a84e4b83f">   37</a></span>    <a class="code hl_enumvalue" href="group__pico__i2c__slave.html#ggad8b613f0d4e9d1b9511ca0b6d6ab7e8ca857dc8c139941a8f8bb6888a84e4b83f">I2C_SLAVE_FINISH</a>,  </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="group__pico__i2c__slave.html#ga8d4821831a9a533b701eca1016021c33">   38</a></span>} <a class="code hl_enumeration" href="group__pico__i2c__slave.html#gad8b613f0d4e9d1b9511ca0b6d6ab7e8c">i2c_slave_event_t</a>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span> </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="group__pico__i2c__slave.html#gaf1bb7bb1e79c309b290bf0e8ccd57dff">   52</a></span><span class="keyword">typedef</span> void (*<a class="code hl_typedef" href="group__pico__i2c__slave.html#gaf1bb7bb1e79c309b290bf0e8ccd57dff">i2c_slave_handler_t</a>)(<a class="code hl_struct" href="structi2c__inst.html">i2c_inst_t</a> *i2c, <a class="code hl_enumeration" href="group__pico__i2c__slave.html#gad8b613f0d4e9d1b9511ca0b6d6ab7e8c">i2c_slave_event_t</a> event);</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span> </div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__pico__i2c__slave.html#ga2ecc43ff4a3c673a704d0c7bd7d91db4">i2c_slave_init</a>(<a class="code hl_struct" href="structi2c__inst.html">i2c_inst_t</a> *i2c, uint8_t address, <a class="code hl_typedef" href="group__pico__i2c__slave.html#gaf1bb7bb1e79c309b290bf0e8ccd57dff">i2c_slave_handler_t</a> handler);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__pico__i2c__slave.html#gaebbea8f5a707f23750ba3e0c8b5eb6ee">i2c_slave_deinit</a>(<a class="code hl_struct" href="structi2c__inst.html">i2c_inst_t</a> *i2c);</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>}</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span> </div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span><span class="preprocessor">#endif </span><span class="comment">// _PICO_I2C_SLAVE_H_</span></div>
<div class="ttc" id="agroup__pico__i2c__slave_html_ga2ecc43ff4a3c673a704d0c7bd7d91db4"><div class="ttname"><a href="group__pico__i2c__slave.html#ga2ecc43ff4a3c673a704d0c7bd7d91db4">i2c_slave_init</a></div><div class="ttdeci">void i2c_slave_init(i2c_inst_t *i2c, uint8_t address, i2c_slave_handler_t handler)</div><div class="ttdoc">Configure an I2C instance for slave mode.</div><div class="ttdef"><b>Definition:</b> i2c_slave.c:56</div></div>
<div class="ttc" id="agroup__pico__i2c__slave_html_gad8b613f0d4e9d1b9511ca0b6d6ab7e8c"><div class="ttname"><a href="group__pico__i2c__slave.html#gad8b613f0d4e9d1b9511ca0b6d6ab7e8c">i2c_slave_event_t</a></div><div class="ttdeci">i2c_slave_event_t</div><div class="ttdoc">I2C slave event types.</div><div class="ttdef"><b>Definition:</b> i2c_slave.h:34</div></div>
<div class="ttc" id="agroup__pico__i2c__slave_html_gaebbea8f5a707f23750ba3e0c8b5eb6ee"><div class="ttname"><a href="group__pico__i2c__slave.html#gaebbea8f5a707f23750ba3e0c8b5eb6ee">i2c_slave_deinit</a></div><div class="ttdeci">void i2c_slave_deinit(i2c_inst_t *i2c)</div><div class="ttdoc">Restore an I2C instance to master mode.</div><div class="ttdef"><b>Definition:</b> i2c_slave.c:81</div></div>
<div class="ttc" id="agroup__pico__i2c__slave_html_gaf1bb7bb1e79c309b290bf0e8ccd57dff"><div class="ttname"><a href="group__pico__i2c__slave.html#gaf1bb7bb1e79c309b290bf0e8ccd57dff">i2c_slave_handler_t</a></div><div class="ttdeci">void(* i2c_slave_handler_t)(i2c_inst_t *i2c, i2c_slave_event_t event)</div><div class="ttdoc">I2C slave event handler.</div><div class="ttdef"><b>Definition:</b> i2c_slave.h:52</div></div>
<div class="ttc" id="agroup__pico__i2c__slave_html_ggad8b613f0d4e9d1b9511ca0b6d6ab7e8ca495a6f0ce75738519ac201349ac38c22"><div class="ttname"><a href="group__pico__i2c__slave.html#ggad8b613f0d4e9d1b9511ca0b6d6ab7e8ca495a6f0ce75738519ac201349ac38c22">I2C_SLAVE_REQUEST</a></div><div class="ttdeci">@ I2C_SLAVE_REQUEST</div><div class="ttdoc">Master is requesting data. Slave must write into Tx FIFO.</div><div class="ttdef"><b>Definition:</b> i2c_slave.h:36</div></div>
<div class="ttc" id="agroup__pico__i2c__slave_html_ggad8b613f0d4e9d1b9511ca0b6d6ab7e8ca7bc1a9bb9db707479c140a49c4d62a51"><div class="ttname"><a href="group__pico__i2c__slave.html#ggad8b613f0d4e9d1b9511ca0b6d6ab7e8ca7bc1a9bb9db707479c140a49c4d62a51">I2C_SLAVE_RECEIVE</a></div><div class="ttdeci">@ I2C_SLAVE_RECEIVE</div><div class="ttdoc">Data from master is available for reading. Slave must read from Rx FIFO.</div><div class="ttdef"><b>Definition:</b> i2c_slave.h:35</div></div>
<div class="ttc" id="agroup__pico__i2c__slave_html_ggad8b613f0d4e9d1b9511ca0b6d6ab7e8ca857dc8c139941a8f8bb6888a84e4b83f"><div class="ttname"><a href="group__pico__i2c__slave.html#ggad8b613f0d4e9d1b9511ca0b6d6ab7e8ca857dc8c139941a8f8bb6888a84e4b83f">I2C_SLAVE_FINISH</a></div><div class="ttdeci">@ I2C_SLAVE_FINISH</div><div class="ttdoc">Master has sent a Stop or Restart signal. Slave may prepare for the next transfer.</div><div class="ttdef"><b>Definition:</b> i2c_slave.h:37</div></div>
<div class="ttc" id="arp2__common_2hardware__i2c_2include_2hardware_2i2c_8h_html"><div class="ttname"><a href="rp2__common_2hardware__i2c_2include_2hardware_2i2c_8h.html">i2c.h</a></div></div>
<div class="ttc" id="astructi2c__inst_html"><div class="ttname"><a href="structi2c__inst.html">i2c_inst</a></div><div class="ttdef"><b>Definition:</b> i2c.h:151</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>